<?php
/**
 * Controle de TipoServico
 * @filesource  06/04/2011
 * @author      Estrada Virtual <http://estradavirtual.com.br>
 * @copyright   Copyright <2011> Estrada Virtual
 * @package     <<application>>
 * @subpackage  <<application>>.application.controllers
 * @version     $Id$
 */
class servico_TipoServicoController extends App_Controller_Crud
{
    public function visualizarAction()
    {
        $id = $this->_getParam('id');
        $tipoServico = new Model_TipoServico();
        $rowTipoServico = $tipoServico->find($id)->current();

        $rowSetClientes = $rowTipoServico->findModel_ClienteViaModel_Servico();
        $aClientes = array();
        foreach ($rowSetClientes as $rowCliente) {
            $aClientes[$rowCliente->id_cliente] = $rowCliente->st_nome;
        }

        $this->view->assign('rowTipoServico', $rowTipoServico);
        $this->view->assign('rowServicos', $rowTipoServico->findModel_Servico());
        $this->view->assign('aClientes', $aClientes);
    }
}
